package cheme.Application;

import org.eclipse.ui.IWorkbenchPreferenceConstants;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
import org.eclipse.ui.application.WorkbenchAdvisor;
import org.eclipse.ui.application.WorkbenchWindowAdvisor;

public class ApplicationWorkbenchAdvisor extends WorkbenchAdvisor
{

	private static final String PERSPECTIVE_ID = "edu.wsu.eecs.ChemE.perspective";

	public WorkbenchWindowAdvisor createWorkbenchWindowAdvisor(
			IWorkbenchWindowConfigurer configurer)
	{
		return new ApplicationWorkbenchWindowAdvisor(configurer);
	}

	public String getInitialWindowPerspectiveId()
	{
		return PERSPECTIVE_ID;
	}
	
	@Override
	public void preStartup()
	{
		/*
		 * This redirects the default lookup for a presentation factory to a Cheme custom one.
		 * As of V1 this is used only to hide the working set toolbar contribution that comes with
		 * some of the IDE plugins used.
		 * 
		 *  In the future this may be used as a starting point to further customize the presentation
		 *  of the Cheme UI.
		 */

		String id = PresentationFactory.ID;
//		String id = "";
		
		PlatformUI.getPreferenceStore().setValue(IWorkbenchPreferenceConstants.PRESENTATION_FACTORY_ID, id);
		
		super.preStartup();
	}
}
